package com.my.app.dbManager.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.my.annotation.Param;
import com.my.annotation.Return;
import com.my.app.dbManager.service.DbManagerService;
import com.my.framework.dao.model.DatabaseInfo;
import com.my.framework.dao.model.TableInfo;
import com.my.framework.web.annotation.Page;
import com.my.framework.web.annotation.Query;
import com.my.framework.web.mvc.controller.BaseController;

@Controller
@RequestMapping("/app/dbManager")
public class DbManangerController extends BaseController{
	@Autowired
	DbManagerService service;
	
	
	@Query(name="查询数据库所有表",path="/tableList")
	public List<TableInfo> tableList(DatabaseInfo databae) {
		return service.tableList(databae);
		
	}
	
	@Query(name="获得单个表",path="/geTable")
	@Param("数据信息")
	@Param("表名")
	@Return("表信息")
	public TableInfo geTable(DatabaseInfo databae,String tableName) {
		return service.getTable(databae,tableName);
		
	}
	
	
	@Page(name="首页",path="/index")
	public void index() {
		
	}
}
